System and method for cluster-sensitive sticky load balancing

ABSTRACT

A system and method for cluster-sensitive sticky load balancing of server workload may include a load balancer receiving an initial request from a client. A session may be initiated in response to receiving the request. The load balancer may relay the initial request to a selected node, where the selected node may be part of a cluster of multiple nodes. Upon receiving a subsequent request pertaining to the session initiated by the initial request, the load balancer may determine if the selected node is active. If the selected node is active, the load balancer may relay the subsequent request to the selected node. If the selected node is not active, the load balancer may determine for which cluster the selected node was a member, and relay the subsequent request to another node in that same cluster.

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] This invention relates to the field of distributed computing systems and, more particularly, to load balancing and fail-over in clustered distributed computing systems.

[0003] 2. Description of the Related Art

[0004] As workloads on modern computer systems become larger and more varied, more and more computational and data resources may be needed. For example, a request from a client to web site may involve a load balancer, a web server, a database, and an application server. Alternatively, some large-scale scientific computations may require multiple computational nodes operating in synchronization as a kind of parallel computer.

[0005] Any such collection of computational resources and/or data resources tied together by a data network may be referred to as a distributed system. Some distributed systems may be sets of identical nodes each at a single location connected together by a local area network. Alternatively, the nodes may be geographically scattered and connected by the Internet, or a heterogeneous mix of computers, each acting as a different resource. Each node may have a distinct operating system and be running a different set of applications.

[0006] Nodes in a distributed system may also be arranged as clusters of nodes, with each cluster working as a single system to handle requests. Alternatively, clusters of nodes in a distributed system may act semi-independently in handling a plurality of workload requests. In such an implementation, each cluster may have one or more shared data sources accessible to all nodes in the cluster.

[0007] Workload may be assigned to distributed system components via a load balancer (or hierarchy of load balancers), which relays requests to individual nodes or clusters. For some requests it may be desirable for a client-specific session history to be maintained by the distributed system. In such an application, a client and a node in the distributed system will typically interact several times, with a response from the node necessitating a subsequent request from a client, which in turn leads to another response from the node, and so on. For example, e-commerce may require that a server be aware of what financial information the client has already provided. This history may be tracked by providing information such as a session tracking number or session identifier (ID) to the client, often in the form of a cookie. This information is returned to the distributed system along with all future transaction requests from the client that are part of the session, so that the distributed system may use the session tracking number to look up previous transaction history and manage multiple concurrent client session histories.

[0008] One difficulty involved with managing session histories is that different nodes in different clusters may not have access to the same data sources, and thus, the same session histories. Alternatively, accessing data in other clusters or nodes may incur excess synchronization overhead or take much longer than accessing data local to a cluster or node. Because of this, load balancers may execute “sticky” load balancing, wherein a client request continuing a given session is sent to the same node that originated the session. Sticky load balancing generally involves a load balancer tracking the node currently handling a given session, often through a node identification number or node address associated with the session ID and/or bundled with the client requests.

[0009] A further difficulty with sticky load balancing may occur when the node handling a client session fails. The load balancer may send client requests for that session to another node in the system that does not have access to the client session history. This may lead to a timeout or communication error, since the new server would be unable to access the client's session history, which may in turn require a failure or restart of the session.

SUMMARY

[0010] A system and method for cluster-sensitive sticky load balancing of server workload is disclosed. The method may include a load balancer receiving an initial request from a client. A session may be initiated and the load balancer may relay the initial request to a selected node, where the selected node may be part of a cluster of multiple nodes. Each node in the cluster may share one or more common data sources, and multiple clusters of multiple nodes may embody a distributed system. Upon receiving a subsequent request relating to the session initiated by the initial request, the load balancer may determine if the selected node is active. If the selected node is active, the load balancer may relay the subsequent request to the initial node. If the selected node is not active, the load balancer may determine which nodes are part of the same cluster as the selected node, and relay the subsequent request to another node in that same cluster.

BRIEF DESCRIPTION OF THE DRAWINGS

[0011]FIG. 1 is a block diagram of a distributed system, according to one embodiment.

[0012]FIG. 2 is a flow diagram illustrating one embodiment of a method for cluster-sensitive sticky load balancing.

[0013]FIG. 3 illustrates a cluster mapping table and session mapping table, according to one embodiment.

[0014]FIG. 4 illustrates an embodiment of a distributed system, including a hierarchical load balancer.

[0015]FIG. 5 is a flow diagram illustrating an embodiment of a method for cluster-sensitive sticky load balancing.

[0016]FIG. 6 illustrates an exemplary computer subsystem for implementing certain embodiments.

[0017] While the invention is susceptible to various modifications and alternative forms, specific embodiments are shown by way of example in the drawings and are herein described in detail. It should be understood, however, that drawings and detailed description thereto are not intended to limit the invention to the particular form disclosed, but on the contrary, the invention is to cover all modifications, equivalents and alternatives falling within the spirit and scope of the present invention as defined by the appended claims.

DETAILED DESCRIPTION OF EMBODIMENTS

[0018] Turning now to FIG. 1, a block diagram of a distributed system 100 is shown. Distributed system 100 includes multiple nodes 110A-L, arranged in clusters 120A-C. Clusters 120A-C are coupled via interconnect 140 to load balancer 150, which is in turn connected to clients 160A-C via network 170.

[0019] Each cluster 120A-C may be operable to handle a plurality of requests from clients 160A-C for a variety of functions. Such functions may include, but are not limited to, acting as a database, web server, directory server, application server, or e-commerce server.

[0020] Load balancer 150 is operable to receive requests from clients 160A-C via network 170 and send these requests to clusters 120A-C in a balanced fashion so that no single cluster 120A-C is overwhelmed with or starved of requests. This process is known as “load balancing” the requests. Requests may be load balanced between clusters 120A-C by a round-robin scheme, a priority-based scheme, a load-tracking scheme, a combination thereof, or any other type of applicable scheme. Load balancer 150 is also operable to execute a method for “sticky” load balancing, as will be described in further detail below.

[0021] Both interconnect 140 and network 170 may be a point-to-point fabric, a local area network (LAN), a wide area network (WAN), the Internet, any other type of computing interconnect, or a combination thereof.

[0022] Each cluster 120A-C includes data source 130A-C, which is connected to the cluster by interconnect 140. All nodes within each cluster may access the same data from the data source 130A-C associated with that particular cluster. It is noted that in one embodiment, nodes in clusters 120A-C may access data sources 130A-C on a non-local cluster. For example, node 110A may access data source 130C. However, such a remote access may take significantly longer than a local access (e.g. node 110A accessing data source 130A).

[0023] It is noted that many of the details in FIG. 1 are purely illustrative, and that other embodiments are possible. For example, load balancer 150 is pictured as a single system separate from clusters 120A-C. However, load balancer 150 may instead be a software process running on a node 110A-L in distributed system 100.

[0024] Furthermore, data sources 130A-C may include databases separate from any of the nodes in clusters 120A-C and include various types of storage, such as RAID arrays. Alternatively, data sources 130A-C may be one or more data sources located on one or more nodes 110A-L within clusters 120A-C. Likewise, the number of nodes and clusters in FIG. 1 should be considered purely illustrative. It is noted that a distributed system may contain any plurality of clusters and nodes.

[0025]FIG. 2 is a flow diagram illustrating a method for cluster-sensitive sticky load balancing. Referring collectively now to FIGS. 1-2, in 200 load balancer 150 receives an initial request from a client 160A-C. In 202 load balancer 150 executes a selection scheme on the pool of available nodes 110A-L in distributed system 100. This selection scheme may be a round-robin scheme, a priority-based scheme, a method based on current workload, any other load balancing scheme, or a combination of these methods.

[0026] Once a node 100A-L has been selected from distributed system 100, load balancer 150 relays the request to the selected node in 204. In 206 the selected node services the request and returns the result back to client 160A-C, along with some type of session information. This session information may be in the form of a cookie, for example. The session information may include information to track a session history, such as a session identification number, a node identification number and/or a node's network address, for example.

[0027] In 208 load balancer 150 receives a subsequent request from the same client 160A-C that sent the original request, pertaining to the session started in 200. The load balancer 150 may determine that the request pertains to an existing session through a session identification number sent along with the request by client 160A-C. This session identification number may then be compared to a session mapping table maintained by load balancer 150 to determine which node 110A-L is the selected node that serviced the original request, as will be discussed further below. Alternatively, client 160A-C may send an identification number or network address associated with the selected node to indicate which node handled the original request.

[0028] In 210 load balancer 150 determines if the selected node is active, and thus able to service the subsequent request. Load balancer 150 may determine the selected node's status through means of a heartbeat tracking method, wherein the load balancer periodically sends out messages to determine which nodes are active.

[0029] Alternatively, load balancer 150 may determine which nodes are active by tracking node response to various requests. For example, if a node 110A-L has failed to respond to any requests in a given time period, load balancer 150 may mark that node 110A-L as unavailable to service future requests. In other embodiments, other techniques may be used to determine the selected node's status, such as using dummy requests, etc.

[0030] If the selected node is determined to be available in step 210, load balancer 150 returns to 204, wherein the subsequent request is forwarded to the selected. The method may then continue through the loop of instructions between 204 and 210 multiple times until the session is ended, as load balancer 150 continually determines that the selected node is able to handle a new subsequent request for the session and forwards the new subsequent request on to the selected node.

[0031] If the selected node is determined to be unavailable in 210, load balancer 150 determines which other nodes 110A-L are part of the same cluster 120A-C as the selected node, as indicated at 212. In one embodiment load balancer 150 may examine a cluster mapping table to determine which nodes 110A-L are grouped into which clusters 120A-C, as will be discussed further below. Alternatively, other methods may be used to determine cluster membership

[0032] In 214 load balancer 150 once more executes a selection scheme on the pool of available nodes 110A-L in distributed system 100, as previously described in step 202, this time limiting the selection scheme to only those nodes 110A-L in the same cluster 120A-C as the initially selected node. The method then returns to 204, where load balancer 150 relays the subsequent request to the newly selected node, which may service the subsequent request using the data source 130A-C to access any relevant session history.

[0033] Turning now to FIG. 3, cluster mapping table 310 and session mapping table 320 are illustrated. In the illustrated embodiment, both tables are local to load balancer 150. Cluster mapping table 310, which represents distributed system 100 as illustrated in FIG. 1, includes three entries, one per cluster 120A-C, each of which identifies the nodes 110A-L comprising that cluster. Session mapping table 320 comprises nine entries in this example, one for each active session being handled by distributed system 100. Each entry lists the specific node 110A-L handling the given session.

[0034] It is further contemplated that, in addition to listing the specific node 110A-L handling each session, each entry in session mapping table 320 may additionally contain an indication of the cluster 120A-C associated with that node. For example, entry 1 in table 320 lists node D as handling session 1. In another embodiment, entry 1 would also list cluster A as the cluster associated with the session, to better facilitate the mechanism for cluster lookup. It is also noted that the number of clusters, sessions, and entries is purely illustrative, and that both cluster mapping table 310 and session mapping table 320 may include any number of relevant entries.

[0035] Turning now to FIG. 4, an alternate embodiment of load balancer 150 from FIG. 1 is shown. Here, load balancer 150 is replaced by a hierarchy of load balancer nodes 400A-D. As before, the load balancing mechanism is coupled to clients 160A-C and clusters 120A-C through network 170 and interconnect 150, respectively.

[0036] In the illustrated embodiment, load balancer 400A receives requests from clients 160A-C via network 170 as described above in FIG. 1. However, rather than relaying requests directly to clusters 120A-C, load balancer 400A may load balance each request to one of load balancers 400B-D, each of which is responsible for further distributing requests to an associated cluster 120A-C. It is noted that the number of load balancers 400A-D and levels in the hierarchy of load balancers may differ from what is illustrated in FIG. 4.

[0037] As described in FIG. 2 above, load balancers 400A-D execute a method for cluster-sensitive sticky load balancing. An initial request from a client 160 A-C may be propagated down to a selected node 110A-H for servicing. As additional requests pertaining to a session initiated by the initial request are sent through load balancers 400A-D, these additional requests are sent to the selected node 110A-H if the selected node is active. If the selected node is inactive, a lower-level load balancer 400B-D may assign the additional requests to another node in the same cluster 120A-C as the selected node.

[0038] Referring to FIGS. 1-4, it is further noted that, in the embodiment illustrated in FIG. 4, the method described in FIG. 2 may not require cluster mapping table 310 for lower-level load balancers 400 B-D. Because each load balancer 400B-D relays requests only to one cluster 120A-C, any node 110A-L accessible by load balancer 400B-D will be part of the same cluster 120A-C as the initially selected node. Thus, any newly selected node 110A-L may have access to the same data source 130A-C, and may thus be able to continue the session history.

[0039]FIG. 5 is a flow diagram illustrating an alternate embodiment a method for cluster-sensitive sticky load balancing. Referring collectively now to FIGS. 2 and 5, in 500 load balancer 150 receives a request from clients 160A-C via network 170. In 502, load balancer 150 executes a selection scheme on the pool of available nodes 1110A-L in distributed system 100.

[0040] In 504, load balancer 150 relays the request to the selected node, which services and returns the request, along with session information, in 506. In 508, load balancer 150 receives a subsequent request related to the same session as the first request from client 160A-C. Using the session information accompanying the subsequent request, load balancer 150 relays the subsequent request to the selected node in 510.

[0041] In 512, load balancer 150 receives an indication that the selected node may be non-functional. This indication may be in the form of a signal from a monitoring process that monitors the status of all nodes 110A-L in distributed system 100. Alternatively, a user may indicate that the selected node is non-functional, or the selected node itself may determine that it is unable to service a request.

[0042] In response to receiving an indication that the selected node is non-functional, load balancer 150 executes a selection scheme on all remaining nodes 110A-L in the same cluster 120A-C as the selected node. In 516, load balancer 150 relays the request to the newly selected node. In one embodiment, load balancer 150 may store a temporary copy of the request in order to forward the request to the newly selected node in response to an indication of a non-functional node 110A-L. Alternatively, in another embodiment, load balancer 150 may signal client 160A-C to resend the request in response to an indication of a non-functional node 110A-L.

[0043] It is thus noted that load balancer 150 may take a more active role in sticky load balancing at the time of failover. It is additionally noted that, in one embodiment, load balancer 150 may modify cluster mapping table 310 and session mapping table 320 upon detection or notification that a selected node is non-functional, thereby removing any current sessions from the failed node, and preventing any other sessions from being started on the failed node until the node is repaired.

[0044] For example, load balancer 150 may receive notification that node 110K in cluster 120C is non-functional. In response, load balancer 150 may search through session mapping table 320 for all sessions associated with node 110K, and reassign those sessions to other nodes in cluster 120C. It is noted that since all nodes in cluster 120C share a common data source 130C, any node in cluster 120C should be able to continue sessions started by node 110K, thus providing a unified system image of the cluster to any clients. In addition, load balancer 150 may modify cluster mapping table 310 to indicate that no further sessions should be moved to node 110K until it is repaired.

[0045] Turning now to FIG. 6, an exemplary computer subsystem 600 is shown. Computer subsystem 600 includes main memory 620, which is coupled to multiple processors 610A-B, and I/O interface 630. It is noted that the number of processors is purely illustrative, and that one or more processors may be resident on the node. I/O interface 630 further connects to network interface 640. Such a system is exemplary of a load balancer, a node in a cluster or any other kind of computing node in a distributed system.

[0046] Processors 610A-B may be representative of any of various types of processors such as an ×86 processor, a PowerPC processor or a CPU from the SPARC family of RISC processors. Likewise, main memory 620 may be representative of any of various types of memory, including DRAM, SRAM, EDO RAM, Rambus RAM, etc., or a non-volatile memory such as a magnetic media, e.g., a hard drive, or optical storage. It is noted that in other embodiments, main memory 600 may include other types of suitable memory as well, or combinations of the memories mentioned above.

[0047] Processors 610A-B of computer subsystem 600 may execute software configured to execute a method of sticky load balancing for clusters in a distributed system, as described in detail above in conjunction with FIGS. 1-5. The software may be stored in memory 620 of computer subsystem 600 in the form of instructions and/or data that implement the operations described above.

[0048] For example, FIG. 6 illustrates an exemplary load balancer 150 stored in main memory 620. The instructions and/or data that comprise central controller 130 and any components contained therein may be executed on one or more of processors 610A-B, thereby implementing the various functionalities of load balancer 150 described above.

[0049] In addition, other components not pictured such as a display, keyboard, mouse, or trackball, for example may be added to node 110. These additions would make node 110 exemplary of a wide variety of computer systems, such as a laptop, desktop, or workstation, any of which could be used in place of node 110.

[0050] Various embodiments may further include receiving, sending or storing instructions and/or data that implement the operations described above in conjunction with FIGS. 1-5 upon a computer readable medium. Generally speaking, a computer readable medium may include storage media or memory media such as magnetic or optical media, e.g. disk or CD-ROM, volatile or non-volatile media such as RAM (e.g. SDRAM, DDR SDRAM, RDRAM, SRAM, etc.), ROM, etc. as well as transmission media or signals such as electrical, electromagnetic, or digital signals conveyed via a communication medium such as network and/or a wireless link.

[0051] Although the embodiments above have been described in considerable detail, numerous variations and modifications will become apparent to those skilled in the art once the above disclosure is fully appreciated. It is intended that the following claims be interpreted to embrace all such variations and modifications. 

What is claimed is:
 1. A method, comprising: receiving an initial request from a client, wherein the initial request initiates a session; relaying the initial request to a selected node, wherein the selected node is part of a cluster of multiple nodes, and wherein the cluster is one of a plurality of clusters in a distributed system; receiving a subsequent request, wherein the subsequent request pertains to the same session; determining if the selected node is active; if the selected node is active, relaying the subsequent request to the selected node; and if the selected node is not active: determining the identity of selected node's cluster; and relaying the subsequent request to another node in the same cluster as the selected node.
 2. The method of claim 1, further comprising maintaining a session mapping table for each cluster, wherein each session mapping table indicates which nodes of its respective cluster in the distributed system are associated with which sessions.
 3. The method of claim 1, wherein said determining the identity of selected node's cluster comprises examining a cluster mapping table, wherein the cluster mapping table indicates which nodes are associated with which clusters.
 4. The method of claim 1, wherein said determining if the selected node is active comprises employing a heartbeat method.
 5. The method of claim 1, wherein said determining if the selected node is active comprises tracking the selected node's response to a previous request.
 6. The method of claim 1, further comprising determining if a request pertains to an existing session through the use of session information provided with the request.
 7. The method of claim 6, wherein the session information comprises a session identification number.
 8. The method of claim 6, wherein said relaying the subsequent request to the selected node comprises using the session information to identify the selected node.
 9. The method of claim 8, wherein the session information comprises the selected node's identification number or the selected node's network address.
 10. The method of claim 6, wherein the session information is provided to the client in the form of a cookie in response to the initial request.
 11. The method of claim 1, wherein the selected node is initially selected by a round-robin selection scheme, a priority-based selection scheme, a load-tracking selection scheme, or a combination thereof.
 12. A distributed system, comprising: a plurality of clusters, wherein each cluster comprises a plurality of nodes; a load balancer, operable to relay requests to individual clusters or nodes, wherein the load balancer is configured to: receive an initial request from a client, wherein the initial request initiates a session; relay the initial request to a selected node; receive a subsequent request, wherein the subsequent request pertains to the same session; determine if the selected node is active; relay the subsequent request to the selected node if the selected node is active; and determine the identity of selected node's cluster and relay the subsequent request to another node in the same cluster as the selected node if the selected node is not active.
 13. The distributed system of claim 12, wherein the load balancer is configured to access a session mapping table, wherein the session mapping table indicates which nodes in the distributed system are associated with which sessions.
 14. The distributed system of claim 12 wherein the load balancer is further operable to examine a cluster mapping table to determine which nodes are associated with which clusters.
 15. The distributed system of claim 12 wherein the load balancer is configured to employ a heartbeat method to determine if the selected node is active.
 16. The distributed system of claim 12 wherein the load balancer is configured to track the selected node's response to a previous request to determine if the selected node is active.
 17. The distributed system of claim 12 wherein the load balancer is configured to determine if a request pertains to an existing session through the use of session information provided with the request.
 18. The distributed system of claim 17, wherein the session information comprises a session identification number.
 19. The distributed system of claim 17 wherein the load balancer is configured to relay the subsequent request to the selected node comprises using the session information to identify the selected node.
 20. The distributed system of claim 19, wherein the session information comprises the selected node's identification number or the initial node's network address.
 21. The method of claim 17, wherein the session information is given to the client in the form of a cookie.
 22. The method of claim 12 wherein the load balancer is configured to initially select the selected node by a round-robin selection scheme, a priority-based selection scheme, a load-tracking selection scheme, or a combination thereof.
 23. A computer accessible medium comprising program instructions executable to implement: receiving an initial request from a client, wherein the initial request initiates a session; relaying the initial request to a selected node, wherein the selected node is part of a cluster of multiple nodes, and wherein the cluster is one of a plurality of clusters in a distributed system; receiving a subsequent request, wherein the subsequent request pertains to the same session; determining if the selected node is active; if the selected node is active, relaying the subsequent request to the selected node; and if the selected node is not active: determining the identity of selected node's cluster; and relaying the subsequent request to another node in the same cluster as the selected node.
 24. The computer accessible medium of claim 23, wherein the program instructions are further executable to implement maintaining a session mapping table for each cluster, wherein each session mapping table indicates which nodes of its respective cluster in the distributed system are associated with which sessions.
 25. The computer accessible medium of claim 23, wherein said determining the identity of selected node's cluster comprises examining a cluster mapping table, wherein the cluster mapping table indicates which nodes are associated with which clusters.
 26. The computer accessible medium of claim 23, wherein said determining if the selected node is active comprises employing a heartbeat method.
 27. The computer accessible medium of claim 23, wherein said determining if the selected node is active comprises tracking the selected node's response to a previous request.
 28. The computer accessible medium of claim 23, wherein the program instructions are further executable to implement determining if a request pertains to an existing session through the use of session information provided with the request.
 29. The computer accessible medium of claim 28, wherein the session information comprises a session identification number.
 30. The computer accessible medium of claim 28, wherein said relaying the subsequent request to the selected node comprises using the session information to identify the selected node.
 31. The computer accessible medium of claim 30, wherein the session information comprises the selected node's identification number or the selected node's network address.
 32. The computer accessible medium of claim 28, wherein the session information is provided to the client in the form of a cookie in response to the initial request.
 33. The computer accessible medium of claim 23, wherein the selected node is initially selected by a round-robin selection scheme, a priority-based selection scheme, a load-tracking selection scheme, or a combination thereof. 